function updQuestionDialog(questionId, callback = Function()) {
    if (!questionId) {
        return $.toast("问题ID不能为空");
    }

    getQuestionDetails({questionId}, ({Code, Message, Result: data}) => {
        if (Code !== 10000) {
            return $.toast(Message);
        }

        const {questionTitle, questionIntro, adImgUrl, price, sortIndex, disableFlag, form} = data;

        const $form = $(`
            <form class="mask-account" style="overflow: auto;overflow-x: hidden">
                <input type="hidden" name="questionId" value="${questionId}">
                <div style="margin: 0">
                    <span class="mask-account-tit"><sub style="color: red;">*</sub> 标题</span>
                    <span class="input-select"><input value="${questionTitle}" type="text" name="questionTitle" placeholder="请输入标题" /></span>
                </div>
                <div>
                    <span class="mask-account-tit">简介</span>
                    <span class="input-select"><input value="${questionIntro}" type="text" name="questionIntro" placeholder="请输入简介" /></span>
                </div>
                <div>
                    <span class="mask-account-tit">广告图</span>
                    <div class="input-select" style="border: 0;padding: 0">
                        <input type="hidden" name="adImgUrl">
                    </div>
                </div>
                <div>
                    <span class="mask-account-tit"><sub style="color: red;">*</sub> 金额</span>
                    <span class="input-select"><input value="${(price / 100).toFixed(2)}" type="number" name="price" placeholder="请输入报名金额(元)" /></span>
                </div>
                <div>
                    <span class="mask-account-tit">排序</span>
                    <span class="input-select"><input value="${sortIndex}" type="number" name="sortIndex" placeholder="排序,小的排前面" /></span>
                </div>
                <div>
                    <span class="mask-account-tit">状态</span>
                    <span data-select="disableFlag"></span>
                </div>
                <div>
                    <span class="mask-account-tit">问卷内容</span>
                    <div class="input-select" data-widget="queForm"  style="">
                    </div>
                </div>
            </form>
        `)

        const $disableFlagSel = $.getSelect("disableFlag", [
            {name: "启用", value: 0},
            {name: "停用", value: 1},
        ])

        $disableFlagSel.setValue(disableFlag);

        $form.find('[data-select="disableFlag"]').append($disableFlagSel);

        const $adImgUrlInput = $form.find('input[name="adImgUrl"]');

        $adImgUrlInput.after(getUploadImgWidget({
            maxCount: 1,
            maxSize: 1024 * 5,
            imageUrls: adImgUrl ? adImgUrl.split(",") : [],
            callback(urlList) {
                $adImgUrlInput.val(urlList.join(","))
            }
        }));


        const formBuilder = questionFormBuilder();
        const $queFormWidget = $form.find('[data-widget="queForm"]')
        $queFormWidget.html(formBuilder.$dom);
        $queFormWidget.hover(function () {
            $(this).css({border: "1px solid #E9EFF4"})
        });
        if (form && form.length) {
            form.forEach(item => {
                formBuilder.addRow(item)
            })
        }


        const $dialogWidget = $.dialog($form, {
            title: "编辑问卷",
            width: "90%",
            init: () => {
                $form.css("max-height", $(window).height() * 0.7);
            },
            ok: () => {
                const data = $.getFormData($form);

                if (formBuilder.rowList.length) {
                    data.formJsonStr = JSON.stringify(formBuilder.rowList);
                }

                if (data.price) {
                    data.price *= 100;
                }

                updQuestion(data, ({Code, Message}) => {
                    if (Code !== 10000) {
                        return $.toast(Message);
                    }

                    $dialogWidget.remove();
                    $.toast("编辑成功");

                    callback();
                })

                return false;

            }
        })
    })


    function updQuestion(data, callback = Function()) {
        return $.sApi({
            data,
            url: "/api/Question/updQuestion"
        }, callback)
    }

    function getQuestionDetails(data, callback = Function()) {
        return $.sApi({
            data,
            url: "/api/Question/getQuestionDetails"
        }, callback)
    }


}